package com.ewuyong.concurrence.example.immutable;

import com.ewuyong.concurrence.annotations.NotThreadSafe;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

@Slf4j
@NotThreadSafe
public class ImmutableExample1 {

    public  final static int a = 1;
    //map线程不安全
    public  final static Map<Integer, Integer> map = Maps.newHashMap();

    static {
        map.put(1, 2);
        map.put(3, 5);

    }

    private void test(final int a){
    }

    public static void main(String[] args) {
        map.put(1, 5);
        System.out.println("args = [" + map.get(1) + "]");
    }
}
